package com.itheima.a03staticdemo3;

import java.util.ArrayList;

public class Test {
    public static void main(String[] args) {
        //1.创建一个集合来储存学生对象
        ArrayList<Student> list = new ArrayList<>();

        //2.创建学生对象
        Student s1 = new Student("zhangsan", 12, "男");
        Student s2 = new Student("lisi", 14, "男");
        Student s3 = new Student("wangwu", 15, "男");

        //3.把学生放到集合当中
        list.add(s1);
        list.add(s2);
        list.add(s3);

        int maxAgeStudent = StudentUtil.getMaxAgeStudent(list);
        System.out.println(maxAgeStudent);
    }
}
